﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DoAnOOP.DataAccessLayer;
using System.Data;
using System.Data.SqlClient;
using System.Windows;
using System.IO;
namespace DoAnOOP.BussinessLayer
{
    class clsBusKetQua_SinhVien
    {

        private DataRow info;
        private DataRow info_khoa;
        public clsBusKetQua_SinhVien()
        {
            clsKetQua_SinhVien clsMyKetQua = new clsKetQua_SinhVien();
            clsLyLichSV clsLyLichSV = new clsLyLichSV();
           
            info = clsLyLichSV.GetLyLichSV();
            info_khoa = clsMyKetQua.GetKhoa();
            clsBusLyLichSV clsMyLyLichSV = new clsBusLyLichSV();
        }
        public DataTable ShowKetQua()
        {
            clsConnect _myConnect = new clsConnect();
            string sql = "SELECT KETQUA.MAMONHOC AS [Mã Môn Học], MONHOC.TENMONHOC AS [Tên Môn Học],KETQUA.DIEMGIUAKY AS [Điểm Giữa kì],KETQUA.DIEMTHUCHANH AS [Điểm Thực hành],KETQUA.DIEMCUOIKY AS [Điểm Cuối kì], KETQUA.DIEMTRUNGBINH AS [Điểm Trung Bình] FROM KETQUA,MONHOC,LYLICH,KHOA WHERE KETQUA.MAMONHOC = MONHOC.MAMONHOC AND KETQUA.MSSV = LYLICH.MSSV AND KHOA.MAKHOA = LYLICH.MAKHOA AND KETQUA.MSSV = '" + frmMain.mssv + "'";
            return _myConnect.GetDataTable(sql);
        }
        public string GetMSSV()
        {
            return info["MSSV"].ToString().Trim();
        }
        public string GetHo()
        {
            return info["HO"].ToString().Trim();
        }
        public string GetTen()
        {
            return info["TEN"].ToString().Trim();
        }
        public string GetMaKhoa()
        {
            return info["MAKHOA"].ToString().Trim();
        }
        public DateTime GetNgaySinh()
        {
            DateTime dt = new DateTime();
            string date = info["NGAYSINH"].ToString();
            dt = DateTime.ParseExact(date, frmMain.TimeFormat, null);
            return dt;
        }
        public string GetGioiTinh()
        {
            return info["GIOITINH"].ToString().Trim();
        }
        public string GetKhoa()
        {
            return info_khoa["TENKHOA"].ToString().Trim();
        }
        public void Export(string _file)
        {


        }



    }
}
